// 工具函数库入口文件

import request from './request'
import * as ErrorHandler from './errorHandler'
import { preventDuplicateSubmit, canSubmit, setSubmitStatus, resetSubmitStatus } from './preventDuplicateSubmit'
import formUtils from './formUtils'
import { formatDate, formatRelativeTime } from './date'

export {
  request,
  ErrorHandler,
  preventDuplicateSubmit,
  canSubmit,
  setSubmitStatus,
  resetSubmitStatus,
  formUtils,
  formatDate,
  formatRelativeTime
}

// 单独导出formUtils中的函数，方便直接使用
export const {
  handleSubmit,
  handleDeleteConfirm,
  handleBatchDeleteConfirm,
  resetForm,
  handleApiError,
  handleCreateUpdate,
  handleFormSave
} = formUtils
